<%-- 
    Document   : lab
    Created on : 2019-2-17, 16:53:57
    Author     : dusin
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
    session.setAttribute("url", "../main/driver.jsp");
%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>        
        <link rel="stylesheet" href="../../js/jquery/themes/default/easyui.css" type="text/css" />
        <link rel="stylesheet" href="../../js/jquery/themes/icon.css" type="text/css" />
        <link rel="stylesheet" href="../../js/jquery/themes/color.css" type="text/css" />
        <link rel="stylesheet" href="../../css/demo.css" type="text/css" />
        <script type="text/javascript" src="../../js/jquery/jquery.min.js"></script>
        <script type="text/javascript" src="../../js/jquery/jquery.easyui.min.js"></script>
        <script type="text/javascript" src="../../js/jquery/locale/easyui-lang-zh_CN.js"></script>
        <script language="JavaScript">
            var uploadID = null;   //上传时，根据字段设置的文件名
            var uploadRecID = null; //上传是相关记录的ID
            var type;
            function identityValidate(value) {
                var city = {11: "北京", 12: "天津", 13: "河北", 14: "山西", 15: "内蒙古", 21: "辽宁", 22: "吉林", 23: "黑龙江 ", 31: "上海",
                    32: "江苏", 33: "浙江", 34: "安徽", 35: "福建", 36: "江西", 37: "山东", 41: "河南", 42: "湖北 ", 43: "湖南",
                    44: "广东", 45: "广西", 46: "海南", 50: "重庆", 51: "四川", 52: "贵州", 53: "云南", 54: "西藏 ", 61: "陕西",
                    62: "甘肃", 63: "青海", 64: "宁夏", 65: "新疆", 71: "台湾", 81: "香港", 82: "澳门", 91: "国外 "};
                var tip = "";
                var pass = true;
                if (!value || !/^[1-9][0-9]{5}(19[0-9]{2}|200[0-9]|2010)(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01])[0-9]{3}[0-9xX]$/i.test(value)) {
                    tip = "身份证号格式错误";
                    pass = false;
                }

                else if (!city[value.substr(0, 2)]) {
                    tip = "地址编码错误";
                    pass = false;
                }
                else {
                    //18位身份证需要验证最后一位校验位
                    if (value.length == 18) {
                        value = value.split('');
                        //∑(ai×Wi)(mod 11)
                        //加权因子
                        var factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
                        //校验位
                        var parity = [1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2];
                        var sum = 0;
                        var ai = 0;
                        var wi = 0;
                        for (var i = 0; i < 17; i++)
                        {
                            ai = value[i];
                            wi = factor[i];
                            sum += ai * wi;
                        }
                        var last = parity[sum % 11];
                        if (parity[sum % 11] != value[17]) {
                            tip = "校验位错误";
                            pass = false;
                        }
                    }
                }
                return pass;
            }
            
            $.extend($.fn.validatebox.defaults.rules, {
                mobileNum: {//验证手机号   
                    validator: function(value, param) {
                        return /^1[3-8]+\d{9}$/.test(value);
                    },
                    message: '请输入正确的手机号码。'
                },
                telNum: {//既验证手机号，又验证座机号
                    validator: function(value, param) {
                        return /(^(0[0-9]{2,3}\-)?([2-9][0-9]{6,7})+(\-[0-9]{1,4})?$)|(^(()|(\d{3}\-))?(1[358]\d{9})$)/.test(value);
                    },
                    message: '请输入正确的电话号码'
                },
                licenseNum: {//既验证手机号，又验证座机号
                    validator: function(value, param) {
                        var flag= identityValidate(value); 
                        return flag;
                    },
                    message: '请输入正确的驾驶证号码'
                },
                isImage: {
                    validator: function(value) {
                        var filename = value.replace(/.*(\/|\\)/, ""), fileExt = (/[.]/.exec(filename)) ? /[^.]+$/.exec(filename.toLowerCase()) : '';
                        if ((fileExt != 'jpg') && (fileExt != 'gif') && (fileExt != 'jpeg') && (fileExt != 'png')) {
                            return false;
                        }
                        return true;
                    },
                    message: '图片格式不正确'
                },
                date: { //校验日期格式 yyyy-MM-dd
                    validator: function(value) {
                        var r = value.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/);
                        if (r == null)
                            return false;
                        var d = new Date(r[1], r[3] - 1, r[4], 0, 0, 0);
                        return (d.getFullYear() == r[1] && (d.getMonth() + 1) == r[3] && d.getDate() == r[4] );
                    },
                    message: '日期格式不正确，请重新输入(2020-01-01)。'
                }
            });
            function formatterStatus(value, row) {
                if (value == 0) {   //这里value的类型是String，不能用‘===’三等号
                    return "<img width='16px' height='16px' src='../../img/icon/seal.png'/>";
                } else if (value == 1) {
                    return "<img width='16px' height='16px' src='../../img/icon/tick.png'/>";
                } else {
                    return "<img width='16px' height='16px'  src='../../img/icon/lock.png'/>"
                }
            }
            $(document).ready(function() {
                $('#dgdriver').datagrid({
                    height: ($(window).height() * 0.7 - 10) + 'px',
                    onClickRow: function(rowIndex, rowData) {
                        //var row = $('#dgdriver').datagrid('getSelected');
                        $('#dgtruck').datagrid('load', {
                            id: rowData.ID
                        });
                    }
                });
                $('#dgtruck').datagrid({
                    height: ($(window).height() * 0.3 - 10) + 'px',
                });
                //alert(($(window).height()*0.3 - 40) + 'px');                    
                $("#upload-photo").click(function() {
                    $('#dlg-upload').dialog('close');
                    if (type == 1 || type == 2) {
                        $('#dgtruck').datagrid('loading');
                    } else {
                        $('#dgdriver').datagrid('loading');
                    }

                    $("#fm-upload").form('submit', {
                        type: "post", //提交方式    
                        dataType: 'json',
                        url: "../../servlet/web/util/UploadPhoto", //请求url
                        onSubmit: function(param) {
                            param.id = uploadRecID;
                            param.uploadID = uploadID;
                            var v = $('#file1').textbox('getValue');
                            if (v === null || v === "") {
                                $.messager.alert({title: '提示',
                                    msg: '请选择一个文件后再上传',
                                    icon: 'info',
                                });
                                return false;
                            }
                        },
                        success: function(data) { //提交成功的回调函数   
                            var data = eval('(' + data + ')');
                            $.messager.alert({title: '提示',
                                msg: data.msg,
                                icon: 'info',
                            });
                            if (type == 1 || type == 2) {
                                //$('#dgtruck').datagrid('loading');                        
                                $('#dgtruck').datagrid('reload');
                            } else {
                                //$('#dgdriver').datagrid('loading');
                                $('#dgdriver').datagrid('reload');
                            }
                        },
                        error: function() {
                            $.messager.alert({title: '提示',
                                msg: data.msg,
                                icon: 'info',
                            });
                            if (type == 1 || type == 2) {
                                $('#dgtruck').datagrid('reload');
                            } else {
                                $('#dgdriver').datagrid('reload');
                            }
                        }
                    });
                });
            });//end of document.ready
            var url;
            function newStudent() {
                //var dd = $('#dgstudent').datagrid('getData');
                $('#dlg').dialog('open').dialog('setTitle', '创建');
                $('#fm').form('clear');
                //$('#studentno1').textbox('readonly',false);                
                url = '../../servlet/web/driver/Save';
            }
            function saveStudent() {
                //alert(url);
                $('#fm').form('submit', {
                    url: url,
                    onSubmit: function(param) {
                        return $(this).form('validate');
                    },
                    success: function(result) {
                        var result = eval('(' + result + ')');
                        if (result.errorMsg) {
                            $.messager.show({
                                title: 'Error',
                                msg: result.errorMsg
                            });
                        } else {
                            $('#dlg').dialog('close');        // close the dialog
                            $('#dgdriver').datagrid('reload');    // reload the user data
                        }
                    }
                });
            }
            function editStudent() {
                var row = $('#dgdriver').datagrid('getSelected');
                if (row) {
                    $('#dlg').dialog('open').dialog('setTitle', '编辑');
                    $('#fm').form('load', row);
                    url = '../../servlet/web/driver/Update';
                }
            }
            function destroyStudent() {
                var row = $('#dgdriver').datagrid('getSelected');
                if (row) {
                    $.messager.confirm('提示',
                            '<font color=\'red\'>删除驾驶员信息，和驾驶员相关的信息将全部删除，请谨慎操作！！！</font><br/>您确定要删除该信息吗?', function(r) {
                                if (r) {
                                    $.post('../../servlet/web/driver/Remove',
                                            {ID: row.ID}, function(result) {
                                        if (result.success) {
                                            $('#dgdriver').datagrid('reload');    // reload the user data
                                        } else {
                                            $.messager.show({// show error message
                                                title: 'Error',
                                                msg: result.errorMsg
                                            });
                                        }
                                    }, 'json');
                                }
                            });
                }
            }
            function doSearch() {
                $('#dgdriver').datagrid('load', {
                    searchKey: $('#productid').val(),
                    status: $('#status').val()
                });
            }
            function refreshStudent() {
                $('#dgdriver').datagrid('reload');    // reload the user data
            }
            function resetPassword() {
                var row = $('#dgdriver').datagrid('getSelected');
                if (row) {
                    $.messager.confirm('提示', '您确定重置该人员密码吗？', function(r) {
                        if (r) {
                            $.post('../../servlet/web/driver/ResetPassword',
                                    {ID: row.ID}, function(result) {
                                if (result.success) {
                                    $.messager.show({// show error message
                                        title: '提示',
                                        msg: '重置成功'
                                    });
                                } else {
                                    $.messager.show({// show error message
                                        title: 'Error',
                                        msg: result.errorMsg
                                    });
                                }
                            }, 'json');
                        }
                    });
                }
            }
            var urlStatus;
            function saveStatus() {
                //alert(url);
                $('#fmStatus').form('submit', {
                    url: urlStatus,
                    onSubmit: function(param) {
                        return $(this).form('validate');
                    },
                    success: function(result) {
                        var result = eval('(' + result + ')');
                        if (result.errorMsg) {
                            $.messager.show({
                                title: 'Error',
                                msg: result.errorMsg
                            });
                        } else {
                            $('#dlgStatus').dialog('close');        // close the dialog
                            $('#dgdriver').datagrid('reload');    // reload the user data
                        }
                    }
                });
            }
            //修改状态
            function editStatus() {
                var row = $('#dgdriver').datagrid('getSelected');
                if (row) {
                    $('#dlgStatus').dialog('open').dialog('setTitle', '编辑');
                    $('#fmStatus').form('load', row);
                    urlStatus = '../../servlet/web/driver/ChangeStatus';
                }
            }
            var urlTruck;
            function newTruck() {
                var dd = $('#dgdriver').datagrid('getSelected');
                if (dd) {
                    $('#driverId').textbox('setText', dd.ID)
                    $('#dlgTruck').dialog('open').dialog('setTitle', '创建');
                    $('#fmTruck').form('clear');
                } else {
                    $.messager.show({
                        title: 'Error',
                        msg: '请选择一个驾驶员操作'
                    });
                }
                //$('#studentno1').textbox('readonly',false);                
                urlTruck = '../../servlet/web/truck/Save';
            }
            function editTruck() {
                var row = $('#dgtruck').datagrid('getSelected');
                if (row) {
                    $('#dlgTruck').dialog('open').dialog('setTitle', '编辑');
                    $('#fmTruck').form('load', row);
                    urlTruck = '../../servlet/web/truck/Update';
                }
            }

            function saveTruck() {
                var dd = $('#dgdriver').datagrid('getSelected');
                //alert(url);
                $('#fmTruck').form('submit', {
                    url: urlTruck,
                    onSubmit: function(param) {
                        param.drId = dd.ID;
                        return $(this).form('validate');
                    },
                    success: function(result) {
                        var result = eval('(' + result + ')');
                        if (result.errorMsg) {
                            $.messager.show({
                                title: 'Error',
                                msg: result.errorMsg
                            });
                        } else {
                            $('#dlgTruck').dialog('close');        // close the dialog
                            $('#dgtruck').datagrid('load', {id: dd.ID});    // reload the user data                            
                        }
                    }
                });
            }
            function destroyTruck() {
                var row = $('#dgtruck').datagrid('getSelected');
                if (row) {
                    $.messager.confirm('提示',
                            '您确定要删除该信息吗?', function(r) {
                                if (r) {
                                    $.post('../../servlet/web/truck/Remove',
                                            {ID: row.ID}, function(result) {
                                        if (result.success) {
                                            $('#dgtruck').datagrid('reload');    // reload the user data
                                        } else {
                                            $.messager.show({// show error message
                                                title: 'Error',
                                                msg: result.errorMsg
                                            });
                                        }
                                    }, 'json');
                                }
                            });
                }
            }
            function refreshTruck() {
                $('#dgtruck').datagrid('reload');    // reload the user data
            }

            function uploadPhoto(t) {
                type = t;
                var row;
                var msg;
                var photoid;
                var typeName;
                if (type === 1) {
                    row = $('#dgtruck').datagrid('getSelected');
                    if (!row) {
                        $.messager.alert({title: '提示',
                            msg: '请选择一条记录',
                            icon: 'info',
                        });
                        return;
                    }
                    msg = "卡车";
                    photoid = 'truck';//车辆
                    typeName = '车辆';
                    uploadID = 'tr' + row.plateNumber;
                    uploadRecID = row.ID;
                } else if (type === 2) {
                    row = $('#dgtruck').datagrid('getSelected');
                    if (!row) {
                        $.messager.alert({title: '提示',
                            msg: '请选择一条记录',
                            icon: 'info',
                        });
                        return;
                    }
                    msg = "卡车";
                    photoid = 'driving';//行驶证
                    typeName = '行驶证'
                    uploadID = 'dr' + row.plateNumber;
                    uploadRecID = row.ID;
                } else if (type === 3) {
                    row = $('#dgdriver').datagrid('getSelected');
                    if (!row) {
                        $.messager.alert({title: '提示',
                            msg: '请选择一条记录',
                            icon: 'info',
                        });
                        return;
                    }
                    msg = "驾驶员";
                    photoid = 'license';//驾照
                    typeName = "驾照";
                    uploadID = 'li' + row.mobilePhone;
                    uploadRecID = row.ID;
                }
                if (row === null) {
                    $.messager.alert('提示', '您还没有选择' + msg + '记录', 'info');
                    return;
                }
                $('#fm-upload').form('clear');
                $('#photoId').textbox('setValue', photoid);
                $('#dlg-upload').dialog('open').dialog('setTitle', '上传' + typeName);
            }
            function anchorPic(value, row) {
                if (value != null && value != '') {
                    return "<a target='view_window' href='../../driver/" + value + "'>" + value + "</a>";
                }
            }
        </script>
    </head>
    <body class="easyui-layout">
        <div region="center" border="true" split="false" style="overflow: hidden; height: 70%;width: 100%">
            <table id="dgdriver" title="驾驶员管理" class="easyui-datagrid"
                   url="../../servlet/web/driver/Load"
                   toolbar="#toolbar"
                   rownumbers="true" fitColumns="true" singleSelect="true">
                <thead>
                    <tr>                
                        <th field="ID" hidden="true">ID</th>
                        <th field="name" width="60">姓名</th>
                        <th field="mobilePhone" width="100">手机号码</th>
                        <th field="licenseNo" width="120">驾驶证号码</th>
                        <th field="dueDate" width="120">有效期</th>
                        <th data-options="field:'license',width:200,formatter:anchorPic" >驾驶证</th> 
                        <th data-options="field:'status',width:200,formatter:formatterStatus" >状态</th> 
                    </tr>
                </thead>
            </table>
            <div id="toolbar">
                <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="newStudent()">增加</a>
                <a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editStudent()">修改</a>
                <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="destroyStudent()">删除</a>            
                <a href="#" class="easyui-linkbutton" iconCls="icon-reload" plain="true" onclick="refreshStudent()">刷新</a>
                <a href="#" class="easyui-linkbutton" iconCls="icon-key" plain="true" onclick="resetPassword()">密码重置</a>
                <a href="#" class="easyui-linkbutton" iconCls="icon-id" plain="true" onclick="uploadPhoto(3)">上传驾照</a>
                <a href="#" class="easyui-linkbutton" iconCls="icon-status" plain="true" onclick="editStatus()">状态</a>
                <span class="datagrid-btn-separator" style="vertical-align: middle;display:inline-block;float:none"></span>
                <select class="easyui-combobox" id="status" name="status" style="width:150px;" 
                        data-options="prompt:'请选择状态',editable:false">
                    <option value="-1">请选择状态</option>
                    <option value="0">待审核</option>
                    <option value="1">正常</option>
                    <option value="9">锁定</option>		
                </select>
                <input id="productid" class="easyui-textbox" style="line-height:26px;border:1px solid #ccc">
                <a href="#" class="easyui-linkbutton" icon_Cls="icon-search" plain="true" onclick="doSearch()">查询</a>
            </div>
        </div>
        <div region="south" border="true" split="false" style="overflow: hidden; height: 30%;width:100%;">
            <table id="dgtruck" title="所属车辆管理" class="easyui-datagrid"
                   url="../../servlet/web/truck/Load"
                   toolbar="#toolbarTruck"
                   rownumbers="true" fitColumns="true" singleSelect="true">
                <thead>
                    <tr>                
                        <th field="ID" hidden="true">ID</th>
                        <th field="plateNumber" width="60">车牌号</th>
                        <th field="brand" width="100">品牌</th>
                        <th field="color" width="200">颜色</th>                    
                        <th field="type" width="60">车型</th>
                        <th field="capacity"  width="60">额定载重</th>
                        <th field="photo"  width="60" data-options="formatter:anchorPic">车辆照片</th>
                        <th field="licensePhoto"  width="60" data-options="formatter:anchorPic">行驶证照片</th>
                    </tr>
                </thead>
            </table>
            <div id="toolbarTruck">
                <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="newTruck()">增加</a>
                <a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editTruck()">修改</a>
                <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="destroyTruck()">删除</a>            
                <a href="#" class="easyui-linkbutton" iconCls="icon-reload" plain="true" onclick="refreshTruck()">刷新</a>
                <a href="#" class="easyui-linkbutton" iconCls="icon-truck" plain="true" onclick="uploadPhoto(1)">上传车辆照片</a>
                <a href="#" class="easyui-linkbutton" iconCls="icon-id" plain="true" onclick="uploadPhoto(2)">上传行驶证</a>
            </div>
        </div>
        <div id="dlg" class="easyui-dialog" style="width:500px;height:350px;padding:5px"
             closed="true" buttons="#dlg-buttons">
            <div class="ftitle">驾驶员信息</div>
            <form id="fm" method="post"> 
                <div class="fitem" style="display:none" >
                    <label>ID:</label>
                    <input id="ID"  class="easyui-textbox" name="ID"  hidden="true" readonly="true" >
                </div>
                <div class="fitem" >
                    <label>姓名:</label>
                    <input id="name"  class="easyui-textbox" name="name"  required="true">
                </div>
                <div class="fitem">
                    <label>手机号码:</label>
                    <input id="mobilePhone" name="mobilePhone" class="easyui-textbox"  data-options="prompt:'请输入正确的手机号码',validType:'mobileNum'" required="true">
                </div>    
                <div class="fitem">
                    <label>驾驶证号码:</label>
                    <input id="licenseNo" name="licenseNo" class="easyui-textbox"  data-options="prompt:'请输入正确的驾驶证号码',validType:'licenseNum'" required="true">
                </div>  
                <div class="fitem">
                    <label>有效期:</label>
                    <input class="easyui-datebox"  id="dueDate" name="dueDate" format="yyyy-MM-dd"
                           data-options="required:true,editable:false" >
                </div>                
            </form>
        </div>
        <div id="dlg-buttons">
            <a href="#" class="easyui-linkbutton" iconCls="icon-ok" onclick="saveStudent()">保存</a>
            <a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')">取消</a>
        </div>

        <div id="dlgStatus" class="easyui-dialog" style="width:500px;height:300px;padding:5px"
             closed="true" buttons="#dlg-buttonsStatus">
            <div class="ftitle">驾驶员状态</div>
            <form id="fmStatus" method="post"> 
                <div class="fitem" style="display:none" >
                    <label>ID:</label>
                    <input id="IDStatus"  class="easyui-textbox" name="ID"  hidden="true" readonly="true" >
                </div>
                <div class="fitem" >
                    <label>姓名:</label>
                    <input id="nameStatus"  class="easyui-textbox" name="name"  readonly="true">
                </div>
                <div class="fitem">
                    <label>手机号码:</label>
                    <input id="mobilePhoneStatus" name="mobilePhone" class="easyui-textbox"  readonly="true">
                </div> 
                <div class="fitem">
                    <label>状态：</label>
                    <select class="easyui-combobox" id="statusStatus" name="status" style="width:150px;" 
                            data-options="prompt:'请选择状态',editable:false">                    
                        <option value="0">待审核</option>
                        <option value="1">正常</option>
                        <option value="9">锁定</option>		
                    </select>
                </div>
            </form>
        </div>
        <div id="dlg-buttonsStatus">
            <a href="#" class="easyui-linkbutton" iconCls="icon-ok" onclick="saveStatus()">保存</a>
            <a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlgStatus').dialog('close')">取消</a>
        </div>

        <div id="dlgTruck" class="easyui-dialog" style="width:500px;height:350px;padding:5px"
             closed="true" buttons="#dlg-buttons">
            <div class="ftitle">卡车信息</div>
            <form id="fmTruck" method="post"> 
                <div class="fitem" style="display:none" >
                    <label>ID:</label>
                    <input id="ID"  class="easyui-textbox" name="ID"  hidden="true" readonly="true" >
                </div>
                <div class="fitem"   style="display:none" >
                    <label>driverId:</label>
                    <input id="driverId"  class="easyui-textbox" name="driverId"  readonly="true" >
                </div>
                <div class="fitem" >
                    <label>车牌:</label>
                    <input id="plateNumber"  class="easyui-textbox" name="plateNumber"  required="true">
                </div>
                <div class="fitem">
                    <label>品牌:</label>
                    <input id="brand" name="brand" class="easyui-textbox"  >
                </div>
                <div class="fitem">
                    <label>颜色:</label>
                    <input id="color" name="color" class="easyui-textbox"  >                    
                </div>
                <div class="fitem">
                    <label>车型:</label>
                    <input id="type" name="type" class="easyui-textbox"  >
                </div>
                <div class="fitem">
                    <label>额定载重:</label>
                    <input id="capacity" name="capacity" class="easyui-numberbox"  >
                </div>
                <div class="fitem">
                    <label>备注:</label>
                    <input id="note" name="note" class="easyui-textbox"  >
                </div>
            </form>
        </div>
        <div id="dlg-buttons">
            <a href="#" class="easyui-linkbutton" iconCls="icon-ok" onclick="saveTruck()">保存</a>
            <a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlgTruck').dialog('close')">取消</a>
        </div>
        <div id="dlg-upload" class="easyui-dialog" style="width:500px;height:280px;padding:10px 20px"
             closed="true" buttons="#dlg-buttons-upload">
            <form id="fm-upload" method="post" enctype="multipart/form-data">                
                <div style="margin-bottom:20px">
                    <input class="easyui-textbox" id="photoId" name="photoId" type="text"  data-options="readonly:true"/>
                    <input class="easyui-filebox" name="file1" id="file1" 
                           data-options="prompt:'选择图片文件...',validType:'isImage',buttonText:'选择文件'" 
                           style="width:100%" required="true">
                </div>                
            </form>
        </div>
        <div id="dlg-buttons-upload">
            <a href="#" id="upload-photo" class="easyui-linkbutton" iconCls="icon-ok" >上传</a>
            <a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg-upload').dialog('close')">取消</a>
        </div>
        <style type="text/css">
            #fm{
                margin:0;
                padding:10px 30px;
            }
            .ftitle{
                font-size:14px;
                font-weight:bold;
                padding:5px 0;
                margin-bottom:10px;
                border-bottom:1px solid #ccc;
            }
            .fitem{
                margin-bottom:5px;
            }
            .fitem label{
                display:inline-block;
                width:80px;
            }
            .fitem input{
                width:160px;
            }
        </style>
    </body>
</html>
